<template>
  <div class="box">{{ 1 + 1 }} : {{ a }} + {{ b }} = {{ c }}</div>
  <div>
    <button @click="add">操作</button>
  </div>
</template>
<script>
import { computed, ref } from 'vue'
export default {
  data() {
    return {
      a: 1,
      b: 2,
      c: null
    }
  },
  methods: {
    add() {
      console.log(`helloworld`)
      this.a++
    }
  },
  mounted() {
    console.log(`helloworld`)
    this.c = computed(() => {
      return this.a + this.b
    })
  }
}
</script>
<style type="text/css">
.box {
  width: 100px;
  height: 100px;
  border: 1px solid #000;
}
</style>
